Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created extensible Stylelint configuration πŸ–οΈ #21

Merged
merged 11 commits into from
Aug 20, 2024

Conversation

01taylop
Copy link
Owner

@01taylop 01taylop commented Aug 4, 2024

Details

  • Lint Pilot supports css, scss, and less.
  • The extendable config avoids extending further configuration files which makes it difficult to know which rules are applied and how they are configured. It is also more difficult to maintain.
    • The config defined in this PR is based on stylelint-config-standard-scss which extends stylelint-config-standard and stylelint-config-recommended-scss, both of which extend stylelint-config-recommended πŸ˜΅β€πŸ’«
  • The extendable config enables other plugins and rules which are considered important or can be automatically fixed.
  • Every rule available in the plugin is defined - if it is not used, it is commented out. This way users can differentiate a rule which was intentionally not enabled versus a rule which was forgotten or not know about when defining the configuration.

What have you changed?

Why are you making these changes?

  • 🎩 Users of Lint Pilot can extend the provided Stylelint configuration.
    • stylelint-config-property-sort-order-smacss is the only config which is extended because as it excels in defining the order of css rules for all syntaxes.
    • Plugins;
      • @stylistic/stylelint-plugin: The 76 rules that enforce stylistic conventions and were removed from Stylelint have been added for users who prefer to use a single tool instead of using both a linter and code formatter.
      • stylelint-declaration-strict-value: Used to enforce using variables or functions for defined properties. This plugin only has 1 rule which teams will likely need to configure to meet their own requirements. The plugin has been included and configured to check any property ending in "color" as well as "fill", "stroke", and "font-size" which are properties which commonly use variables or functions to better maintain the code.
      • stylelint-order: The stylelint-config-property-sort-order-smacss config defines order/properties-order available from this plugin. We also define order/order to define the grouping order for css, scss, and less.
      • stylelint-scss: Scss-specific rules are applied only to .scss files.
  • πŸ“« postcss is used to better support SCSS and Less syntax.

01taylop added 10 commits August 2, 2024 17:37
Presets;

1. `stylelint-config-standard-scss`
  1.1. `stylelint-config-standard`
    1.1.1. `stylelint-config-recommended`
  1.2. `stylelint-config-recommended-scss`
    1.2.1. `stylelint-config-recommended`

Changes;

- Disabled rules not relevant to SCSS/Sass.
- Updated kebab-case regex pattern to allow numbers.
- Improved messages for rules using regex patterns.
- Support custom elements.
@01taylop 01taylop changed the title Install stylelint plugins πŸ–οΈ Created extensible Stylelint config πŸ–οΈ Aug 20, 2024
@01taylop 01taylop changed the title Created extensible Stylelint config πŸ–οΈ Created extensible Stylelint configuration πŸ–οΈ Aug 20, 2024
@01taylop 01taylop marked this pull request as ready for review August 20, 2024 11:05
@01taylop 01taylop merged commit 4cc9811 into main Aug 20, 2024
5 checks passed
@01taylop 01taylop deleted the stylelint-config branch August 20, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant